﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using CLEX.DataContracts;

namespace CLEX.ServiceContracts
{
    [ServiceContract]
    public interface IAdminService
    {
        [OperationContract]
        List<DatabaseData> GetAllDatabases();

        [OperationContract]
        DatabaseData GetDatabase(int databaseId);

        [OperationContract]
        DatabaseData CreateDatabase(DatabaseData database);

        [OperationContract]
        void UpdateDatabase(DatabaseData database);

        [OperationContract]
        void DeleteDatabase(DatabaseData database);



        [OperationContract]
        List<FriendRequestData> GetAllFriendRequests();

        [OperationContract]
        FriendRequestData GetFriendRequest(int fromUserId, int toUserId);

        [OperationContract]
        FriendRequestData CreateFriendRequest(FriendRequestData friendRequest);

        [OperationContract]
        void UpdateFriendRequest(FriendRequestData friendRequest);

        [OperationContract]
        void DeleteFriendRequest(FriendRequestData friendRequest);



        [OperationContract]
        List<FriendshipData> GetAllFriendships();

        [OperationContract]
        FriendshipData GetFriendship(int user1Id, int user2Id);

        [OperationContract]
        FriendshipData CreateFriendship(FriendshipData friendship);

        [OperationContract]
        void UpdateFriendship(FriendshipData friendship);

        [OperationContract]
        void DeleteFriendship(FriendshipData friendship);



        [OperationContract]
        List<SharedDatabaseData> GetAllSharedDatabases();

        [OperationContract]
        SharedDatabaseData GetSharedDatabase(int databaseId, int sharedUserId);

        [OperationContract]
        SharedDatabaseData CreateSharedDatabase(SharedDatabaseData sharedDatabase);

        [OperationContract]
        void UpdateSharedDatabase(SharedDatabaseData sharedDatabase);

        [OperationContract]
        void DeleteSharedDatabase(SharedDatabaseData sharedDatabase);


        [WebInvoke(Method = "POST",
           RequestFormat = WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json,
           UriTemplate = "players")]
        [OperationContract]
        List<UserData> GetAllUsers();

        [OperationContract]
        UserData GetUser(int userId);

        [OperationContract]
        UserData CreateUser(UserData user);

        [OperationContract]
        void UpdateUser(UserData user);

        [OperationContract]
        void DeleteUser(UserData user);
    }
}
